//
//  ViewController.m
//  cacheTool
//
//  Created by 牟华 on 16/10/27.
//  Copyright © 2016年 牟华. All rights reserved.
//

#import "ViewController.h"
#import "MHCacheDiskHelper.h"


@interface Student : NSObject

@property (strong, nonatomic) NSString *name;

@property (strong, nonatomic) NSString *score;

@property (strong, nonatomic) NSArray *friends;

@end

@implementation Student

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.name = @"hahaha";
        self.score = @"99.9";
        self.friends = @[@"Alley", @"Green", @"Lala"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:self.score forKey:@"score"];
    [aCoder encodeObject:self.friends forKey:@"friends"];
}

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super init];
    if (self) {
        self.name = [coder decodeObjectForKey:@"name"];
        self.score = [coder decodeObjectForKey:@"score"];
        self.friends = [coder decodeObjectForKey:@"friends"];
    }
    return self;
}


@end


@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *showView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    mh.saveImage(@"newImage", [UIImage imageNamed:@"1536-2048"], ^{
        
        mh.getImage(@"newImage", ^(UIImage *image) {
            self.showView.image = image;
        });
    });
    
    
    
//    mh.saveVoice
}


@end
